<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   <%@include file="/view/resource.jsp" %>
   <script type="text/javascript">
   <%String flag =(String)request.getAttribute("flag");
   if(flag != null && flag.equalsIgnoreCase("add")){
    %>
  	var flag=true;
    <%}else{ %>var flag=false;<%}%>
 function fspace(num){
	var str = "";
	for(var i=0;i<num;i++){
		str+="&nbsp;";
	}
	return str;
}

$(document).ready(function (){
		$("#lie").ready(function (){
			$.ajax({
				url: "getPjPush.do",
				dataType:'json',
				success:function (result){
					 var str='<select name="hdpId" id="hdpId"  onchange="hdpchange()">';
					for(var i=0;i<result.total;i++){
						str+="<option value='"+result.data[i].id+"'>"+result.data[i].hdpName+"</option>";
					}
					str+='</select>';
					document.getElementById("lie").innerHTML=str;
				}
			});
		});
});
    
    
    </script>
   <!--  id对应的名称 -->
  </head>

  <body class="easyui-layout">
     <!-- DataList  -->
	 <div region="center" border="false" >
     	<table id="data-list" ></table>
     </div>
    
     <!-- Edit Win&From -->
     <div id="edit-win" class="easyui-dialog"  title="操作项目提成明细" data-options="closed:true,iconCls:'icon-save',modal:true"  style="width:500px;height:450px;">  
     	<form id="editForm" class="ui-form" method="post"> 
     	 <!-- 隐藏文本框 -->
     	 <input class="hidden" name="id">
     	 <input class="hidden" name="deleted">
    	 <input class="hidden" name="parentId" id='edit_parentId'>
    	 <input class="hidden" name="pjId" id="pushPjid" value='${pushmy.pjId}'>
	            <div data-options="region:'north',split:true" style="height:185px;padding:10px">  
	               <div class="ftitle">详细</div> 
	               
		           <div class="fitem">  
		               <label>部门名称:</label> 
		                <span id="lie"></span>
		               <span id="liedepart"></span>
		               <input type="hidden" name="hdpName" id="hdpName">
		           </div> 
		           <script>
		           function hdpchange(){
		            var obj = document.getElementById("hdpId");
		            var index = obj.selectedIndex; // 选中索引
		           	var text = obj.options[index].text;
		           	document.getElementById("hdpName").value=text;
		           }
		           
		            function getcont(){
			    	 	tmulti('t5','t4','t1');
			    	 	tsum('t6','t3','t5');
			    	 }
		           function getarea(){
		           var t2=document.getElementById("t2").value;
		           if(t2!=null && t2!=''){
		           		tmulti('t3','t1','t2');
		           	}
		           }
		           </script>
	                 
		           <div class="fitem">  
		               <label>建筑类型:</label>  
		               <select id="checktype" name="ppuType" data-options="required:true">
		              <c:forEach items="${cptype}" var="cptype"> 
		            	<option value="${cptype.key}">${cptype.value.paName }</option>
						</c:forEach>
                   	</select>
		           </div>  
		           <div class="fitem">  
		               <label>建筑面积（平方米）:</label>  
		               <input class="easyui-numberbox" precision="2"  id="t1"  missingMessage="请输入数字" onKeyUp="getarea()" required="true" type="text" name="ppuArea" data-options="required:true">
		           </div>  
		           <div class="fitem">  
		               <label>基础提成单价:</label>  
		               <input class="easyui-numberbox" precision="2" id="t2" missingMessage="请输入数字"   onblur="tmulti('t3','t1','t2')" onKeyUp="tmulti('t3','t1','t2');" required="true" type="text" name="ppuPrice" data-options="required:true">
		           </div>  
		           <div class="fitem">  
		               <label>基础提成:</label>  
		               <input class="easyui-validatebox" id="t3" missingMessage="请输入数字"  required="true" type="text" name="ppuBasepercent" data-options="required:true">
		           </div>  
		           <div class="fitem">  
		               <label>奖励提成单价:</label>  
		               <input class="easyui-numberbox" precision="2" id="t4" missingMessage="请输入数字" onblur="getcont()" onKeyUp="getcont()" required="true" type="text" name="ppuAward" data-options="required:true">
		           </div>  
		           <div class="fitem">  
		               <label>奖励提成:</label>  
		               <input class="easyui-validatebox" id="t5" missingMessage="请输入数字"  required="true" type="text" name="ppuAwardpercent" data-options="required:true">
		           </div>  
		           <div class="fitem">  
		               <label>合计（元）:</label>  
		               <input class="easyui-validatebox" id="t6"  missingMessage="请输入数字"  required="true" type="text" name="ppuCount" data-options="required:true">
		           </div>  
		     </div>
     	</form>
  	 </div>
  <script type="text/javascript" src="<%=basePath%>/osjs/project/TostPjPushmoney.js"></script>
  </body>
</html>
